
import os
from utils.util import get_qwen_models

# 连接数据库db文件的地址根据需要需要更换




LLM = get_qwen_models()[0]
CHAT = get_qwen_models()[1]
EMBED = get_qwen_models()[2]



# ---------------------------------------------------------------------------------------------------------------------

"""
Chroma向量数据库使用时的相关的配置
"""
# 默认的ChromaDB的服务器类别  http
CHROMA_SERVER_TYPE = "local"
# 默认本地数据库的持久化目录  I:\AI_live_study_wokspace\chroma_db
CHROMA_PERSIST_DB_PATH = "../../../../chroma_db"

CHROMA_HOST = os.getenv("CHROMA_HOST", "localhost")
CHROMA_PORT = int(os.getenv("CHROMA_PORT", 8000))
CHROMA_COLLECTION_NAME = "langchain"

# 默认导入PDF时使用local方式导入
CHROMA_SERVER_TYPE_IMPORT = "local"

"""
Milvus向量数据库使用时的相关的配置
"""
# 默认的ChromaDB的服务器类别
MILVUS_SERVER_TYPE = "http"
MILVUS_HOST = "localhost"
MILVUS_PORT = 19530
MILVUS_COLLECTION_NAME = "langchain"

"""
本地SQLite数据库相关的配置
"""
# 获取当前文件的绝对路径
current_file_path = os.path.abspath(__file__)

# 向上取两级找到根目录
root_directory = os.path.dirname(os.path.dirname(current_file_path))

# 拼接最终的数据库路径
# 本地SQLite数据库的路径
#SQLDATABASE_URI = 'sqlite:///' + os.path.join(root_directory, "dataset", "dataset", "博金杯比赛数据.db")
SQLDATABASE_URI = 'sqlite:///' + "I:/ai_live_workspace/smart-finance-bot/博金杯比赛数据.db"

# 使用MySQL数据库
# SQLDATABASE_URI = 'mysql+pymysql://smart_admin:123abc@localhost:3306/smart_bot'

"""
ES数据库相关的配置
"""
# ES服务开关：True表示开启ES服务，False表示关闭ES服务
ELASTIC_ENABLE_ES = True
ELASTIC_PASSWORD = os.getenv("ELASTIC_PASSWORD", "123abc")
ELASTIC_HOST = os.getenv("ELASTIC_HOST", "14.103.170.52")
ELASTIC_PORT = os.getenv("ELASTIC_PORT", 9200)
ELASTIC_SCHEMA = "http"
ELASTIC_INDEX_NAME = "smart_test_index"


"""
COMPRESSOR 检索器相关的配置
"""
COMPRESSOR_ENABLE = True
